package com.guazi.trackingtest;

import android.util.Log;

import org.java_websocket.WebSocket;
import org.java_websocket.handshake.ClientHandshake;
import org.java_websocket.server.WebSocketServer;

import java.net.InetSocketAddress;

/**
 * Created by lqy on 2018/3/13.
 */

public class Server extends WebSocketServer {

    public Server(int port){
        super(new InetSocketAddress(port));
    }

    public Server(InetSocketAddress address){
        super(address);
    }

    @Override
    public void onOpen(WebSocket conn, ClientHandshake handshake) {
        Log.e("lqy", "onOpen");
    }

    @Override
    public void onClose(WebSocket conn, int code, String reason, boolean remote) {
        Log.e("lqy", "onClose");
    }

    @Override
    public void onMessage(WebSocket conn, String message) {
        Log.e("lqy", "onMessage -> " + message);
    }

    @Override
    public void onError(WebSocket conn, Exception ex) {
        Log.e("lqy", "onError");
    }

    @Override
    public void onStart() {
        Log.e("lqy", "onStart");
    }
}
